//
//  BrandModel.swift
//  shop
//
//  Created by chen on 2025/5/18.
//

import SwiftUI

struct BrandResp: Codable {
    var currentPage: Int64
    @SafeArray var lists: [BrandItem]
    var pageSize: Int64
    var totalCount: Int64
    
    init(currentPage: Int64 = 0, lists: [BrandItem] = [], pageSize: Int64 = 0, totalCount: Int64 = 0) {
        self.currentPage = currentPage
        self.lists = lists
        self.pageSize = pageSize
        self.totalCount = totalCount
    }
}

struct BrandItem: Codable {
    var brandId: Int64
    var brandName: String
    var brandLogo: String
    var sales: Int64
    var maxDiscountAmount: Double
    var maxDiscount: Double
    @SafeArray var goodsList: [BrandGoodItem]
    var brandFeatures: String
    
    init(brandId: Int64 = 0,
         brandName: String = "",
         brandLogo: String = "",
         sales: Int64 = 0,
         maxDiscountAmount: Double = 0,
         maxDiscount: Double = 0,
         goodsList: [BrandGoodItem] = [],
         brandFeatures: String = "") {
        self.brandId = brandId
        self.brandName = brandName
        self.brandLogo = brandLogo
        self.sales = sales
        self.maxDiscountAmount = maxDiscountAmount
        self.maxDiscount = maxDiscount
        self.goodsList = goodsList
        self.brandFeatures = brandFeatures
    }
}

struct BrandGoodItem: Codable {
    let id: Int64
    let dTitle: String
    let originPrice: Double
    let actualPrice: Double
    let monthSales: Int64
    let mainPic: String
}

struct BrandType: Codable {
    let type: Int
    let name: String
}
